// Package server 服务层
package server

import (
	"fmt"
	"github.com/robfig/cron/v3"
	"log"
)

type ServerService struct{}

// TaskStart 定时任务
func TaskStart(serverConfig map[string]string) {
	fmt.Print(`  ____   ___   _   _   __  __   ___   _   _ 
 / ___| |_ _| | \ | | |  \/  | |_ _| | \ | |
| |  _   | |  |  \| | | |\/| |  | |  |  \| |
| |_| |  | |  | |\  | | |  | |  | |  | |\  |
 \____| |___| |_| \_| |_|  |_| |___| |_| \_|
============================================
`)
	var service *ServerService
	c := cron.New(cron.WithSeconds())
	c.AddFunc("0/10 * * * * ?", service.Test)
	c.Start()
	log.Println("[ginmin] 定时任务注册成功")
}

func (service *ServerService) Test() {

}
